﻿using SlimDX;

namespace GamepadDriver
{
    public static class MathHelper
    {
        /// <summary>
        /// Ensure that the value is within the given range.
        /// </summary>
        public static bool IsInRange(double min, double max, double value)
        {
            return (min <= value) && (value <= max);
        }

        /// <summary>
        /// Ensure that each component of the vector is within the given range.
        /// </summary>
        public static bool IsInRange(double min, double max, Vector3 position)
        {
            return IsInRange(min, max, position.X) && IsInRange(min, max, position.Y) && IsInRange(min, max, position.Z);
        }
    }
}